﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" import="java.sql.*" %>
<jsp:useBean id="connDbBean" scope="page" class="com.util.db"/>

<script type="text/javascript" src="js/My97DatePicker/WdatePicker.js" charset="gb2312"></script>
<script type="text/javascript" src="js/popup.js"></script>
<script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<TITLE>添加家教老师</TITLE>
	    
 	<link rel="stylesheet" href="images/hsgcommon/common.css" type="text/css">
	<link rel="stylesheet" href="images/hsgcommon/div.css" type="text/css">    
	</head>
<%
  String id="";
   %>

<script language="javascript">

function gows()
{
	document.location.href="jiajiaolaoshi_add.jsp?id=<%=id%>";
}
function hsgxia2shxurxu(nstr,nwbk)
{
	if (eval("form1."+nwbk).value.indexOf(nstr)>=0)
	{
		eval("form1."+nwbk).value=eval("form1."+nwbk).value.replace(nstr+"；", "");
	}
	else
	{
		eval("form1."+nwbk).value=eval("form1."+nwbk).value+nstr+"；";
	}
}
</script>
	<body>
			<form action="addJiajiaolaoshi.do" name="form1" method="post">
				      <table width="100%" border="1" align="center" cellpadding="3" cellspacing="1"  style="border-collapse:collapse" bgcolor="#F2FDFF">
						<tr bgcolor="#E7E7E7">
							<td height="30" colspan="2" background="images/table_header.gif">添加家教老师</td>
						</tr>
						<tr ><td width="200">教师姓名：</td><td><input name='jiaoshixingming' type='text' id='jiaoshixingming' value='' onblur='checkform()' class="form-control" />&nbsp;*<label id='clabeljiaoshixingming' style='margin-top:16px;' /></td></tr>
						<tr ><td width="200">主教课程：</td><td><input name='zhujiaokecheng' type='text' id='zhujiaokecheng' value='' onblur='checkform()' class="form-control" />&nbsp;*<label id='clabelzhujiaokecheng' style='margin-top:16px;' /></td></tr>
	
		<tr ><td width="200">教龄：</td><td><input name='jiaoling' type='text' id='jiaoling' value='' onblur='checkform()' class="form-control" />&nbsp;*<label id='clabeljiaoling' style='margin-top:16px;' /></td></tr>
		<tr ><td width="200">学历：</td><td><select name='xueli' id='xueli' class="form-control"><option value="本科">本科</option><option value="硕士">硕士</option><option value="博士">博士</option></select>&nbsp;*<label id='clabelxueli' style='margin-top:16px;' /></td></tr>
		<tr ><td width="200">照片：</td><td><input name='zhaopian' type='text' id='zhaopian' size='50' value='' onblur=''  class="form-control" /><div style="margin-top:16px;">&nbsp;<input type='button' value='上传' onClick="up('zhaopian')"/></div></td></tr>
		<tr ><td width="200">联系电话：</td><td><input name='lianxidianhua' type='text' id='lianxidianhua' value='' onblur='hsgcheck()' class="form-control" />&nbsp;*<label id='clabellianxidianhua' style='margin-top:16px;' /></td></tr>
		<tr ><td width="200">费用：</td><td><input name='feiyong' type='text' id='feiyong' value='' onblur='checkform()' class="form-control" />&nbsp;*<label id='clabelfeiyong' style='margin-top:16px;' /></td></tr>
		<tr ><td width="200">教师简介：</td><td><textarea name='jiaoshijianjie' cols='50' rows='5' id='jiaoshijianjie' onblur='checkform()' class="form-control" style="width:600px; height:80px;" ></textarea>&nbsp;*<label id='clabeljiaoshijianjie' style='margin-top:16px;' /></td></tr>
		
		
						<tr align='center'   height="22">
						    <td height="45"  align="right">&nbsp;						    </td>
						    <td width="75%"  align="left">
						       <input type="submit" name="querenzhuce" id="querenzhuce" value="提交" onClick="return checkform();" class="btn btn-info btn-small"/>
						       <input type="reset" value="重置" name="Submit2" class="btn btn-info btn-small"/>&nbsp;
						    </td>
						</tr>
					 </table>
			</form>
   </body>
</html>




<script language=javascript >  
function hsgcheck() {
		var lianxidianhua = $("#lianxidianhua").val();
		if(lianxidianhua==""||(lianxidianhua.length<3||lianxidianhua.length>12)){
			 $("#clabellianxidianhua").html("<font color=red>联系电话不能为空且长度在3～12位之间！</font>");
			 $("input[id=lianxidianhua]").focus();
			 $("#querenzhuce").attr("disabled","disabled");
			 return false;
		} 
		else
		{
			$("#clabellianxidianhua").html("");
			$.ajax({
				url : "quchongJiajiaolaoshi.do",
				type : "post",
				data : "lianxidianhua=" + lianxidianhua,
				dataType : "json",
				success:function(result){
				if(result.info=="ng"){
					$("#clabellianxidianhua").html("<font color=red>联系电话已存在，请更换！</font>");
					$("input[id=lianxidianhua]").focus();
					$("#querenzhuce").attr("disabled","disabled");
					return false;
				}
				else
				{
					$("#querenzhuce").removeAttr("disabled");
				}
				},
				error:function(){
					$("#clabellianxidianhua").html("系统异常，请检查错误！");
					$("input[id=lianxidianhua]").focus();
					$("#querenzhuce").attr("disabled","disabled");
					return false;
				}
			});
		}
	}
</script>


<script language=javascript >  
 
 function checkform(){  
 
	var jiaoshixingmingobj = document.getElementById("jiaoshixingming"); if(jiaoshixingmingobj.value==""){document.getElementById("clabeljiaoshixingming").innerHTML="&nbsp;&nbsp;<font color=red>请输入教师姓名</font>";return false;}else{document.getElementById("clabeljiaoshixingming").innerHTML="  "; } 
	var zhujiaokechengobj = document.getElementById("zhujiaokecheng"); if(zhujiaokechengobj.value==""){document.getElementById("clabelzhujiaokecheng").innerHTML="&nbsp;&nbsp;<font color=red>请输入主教课程</font>";return false;}else{document.getElementById("clabelzhujiaokecheng").innerHTML="  "; } 
	var jiaolingobj = document.getElementById("jiaoling"); if(jiaolingobj.value==""){document.getElementById("clabeljiaoling").innerHTML="&nbsp;&nbsp;<font color=red>请输入教龄</font>";return false;}else{document.getElementById("clabeljiaoling").innerHTML="  "; } 
	var xueliobj = document.getElementById("xueli"); if(xueliobj.value==""){document.getElementById("clabelxueli").innerHTML="&nbsp;&nbsp;<font color=red>请输入学历</font>";return false;}else{document.getElementById("clabelxueli").innerHTML="  "; } 
	var lianxidianhuaobj = document.getElementById("lianxidianhua"); if(lianxidianhuaobj.value==""){document.getElementById("clabellianxidianhua").innerHTML="&nbsp;&nbsp;<font color=red>请输入联系电话</font>";return false;}else{document.getElementById("clabellianxidianhua").innerHTML="  "; } 
	var lianxidianhuaobj = document.getElementById("lianxidianhua"); if(lianxidianhuaobj.value!=""){ if(/^(([0\+]\d{2,3}-)?(0\d{2,3})-)?(\d{7,8})(-(\d{3,}))?$/.test(lianxidianhuaobj.value) || /^1[3|4|5|6|7|8|9][0-9]\d{8,8}$/.test(lianxidianhuaobj.value)){document.getElementById("clabellianxidianhua").innerHTML=""; }else{document.getElementById("clabellianxidianhua").innerHTML="&nbsp;&nbsp;<font color=red>必需电话格式[7或8位电话，或11位手机]</font>"; return false;}}  
    var feiyongobj = document.getElementById("feiyong"); if(feiyongobj.value==""){document.getElementById("clabelfeiyong").innerHTML="&nbsp;&nbsp;<font color=red>请输入费用</font>";return false;}else{document.getElementById("clabelfeiyong").innerHTML="  "; } 
	var feiyongobj = document.getElementById("feiyong"); if(feiyongobj.value!=""){ if(/^[0-9]+.?[0-9]*$/.test(feiyongobj.value)){document.getElementById("clabelfeiyong").innerHTML=""; }else{document.getElementById("clabelfeiyong").innerHTML="&nbsp;&nbsp;<font color=red>必需数字型</font>"; return false;}}  
    var jiaoshijianjieobj = document.getElementById("jiaoshijianjie"); if(jiaoshijianjieobj.value==""){document.getElementById("clabeljiaoshijianjie").innerHTML="&nbsp;&nbsp;<font color=red>请输入教师简介</font>";return false;}else{document.getElementById("clabeljiaoshijianjie").innerHTML="  "; } 
	


return true;   
}   
popheight=450;
</script>  
<script src="images/hsgcommon/jq.js"></script>
<script src="images/hsgcommon/common.js"></script>
<script src="images/hsgcommon/bootbox.js"></script>